﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace Hue {
	public class ColorHelper {

		public static string ToHEX(Color c) {
			return ColorTranslator.ToHtml(c);
		}

		public static string ToRGBString(Color c) {
			return string.Format("{0}, {1}, {2}", c.R, c.G, c.B);
		}

		public static Color ToDarkerColor(Color c) {
			return ControlPaint.Dark(c);
		}

		public static Color ToDarkerColor(Color c, float percent) {
			return ControlPaint.Dark(c, percent);
		}

		public static Color ToLighterColor(Color c) {
			return ControlPaint.Light(c);
		}

		public static Color ToLighterColor(Color c, float percent) {
			return ControlPaint.Light(c, percent);
		}

		public static List<Color> GetColorGradients(Color c, int steps) {
			List<Color> returnValue = new List<Color>();

			Color cs = ControlPaint.LightLight(c);
			cs = ControlPaint.LightLight(cs);

			for (int i = 0; i < steps; i++) {
				cs = ToDarkerColor(cs, .01f);
				returnValue.Add(cs);
			}

			return returnValue;
		}




	}
}
